package com.dbappsecurity.network.client.interceptor;

import okhttp3.Headers;

import java.util.Map;

/**
 * Created by Arirus on 2017/8/11.
 */

public class InterceptorHelper {

  public static Headers.Builder defaultHeader() {
    Headers.Builder builder = new Headers.Builder();
    builder.add("Content-Encoding", "gzip").add("X-Client-Type", "android");

    return builder;
  }

  //这个类要在获得、更新Token的时候进行存储 // TODO: 2017/8/11 sharedreference 存储
  //每局单例实现
  public enum TokenWrapper {
    INSTANCE;

    private String token = null;

    public String getToken() {
      return token;
    }

    public void setToken(String token) {
      if (token == null) return;
      this.token = token;
    }
  }

  public interface Transformer{
    Map<String,String> trans(Map<String, String> map);
  }

  public interface ModifyParms {
    Map<String,String> modify(Map<String, String> map);
  }

}
